<?php exit;
    if (!empty($threadlist)) {
        $threadlistview_default = '';
        $enable_flags = &GetThreadListViewPostFlags($threadlistview_default);
        $tl_PostFlagCfg = &$GLOBALS['PostFlagCfg'];
        $tl_flags = &$tl_PostFlagCfg['Flags'];
        if (!empty($enable_flags)) {
            $PostFlagTable = $tl_PostFlagCfg['table'];
            $flag_fields = array('tid');
            foreach ($enable_flags as $enable_flag) {
                $flag_fields[] = $enable_flag;
                $flag_fields[] = $enable_flag . '_g';
                $flag_fields[] = $enable_flag . '_u';
            }
            $threadkeys = array_keys($threadlist);
            $threadkeylen = count($threadkeys);
            $postflagRS = db_find($PostFlagTable, array('hide' => 0, 'isfirst' => 1, 'tid' => $threadkeys), array(), 1, $threadkeylen, 'tid', $flag_fields);
            if (!empty($postflagRS)) {
                global $gid, $uid;
                $_curGid = intval($gid);
                $_curUid = intval($uid);
                for ($tki = 0; $tki < $threadkeylen; $tki++) {
                    $p_tid = (int)$threadkeys[$tki];
                    $p_thread = &$threadlist[$p_tid];
                    if (isset($postflagRS[$p_tid])) {
                        $p_postflag = &$postflagRS[$p_tid];
                        $thread_AdditionClass = array();
                        $other_thread_AdditionStamp = array();
                        $F_denied = false;
                        foreach ($p_postflag as $_fgFieldK => &$_fgFieldV) {
                            if ($_fgFieldK == 'tid') continue;
                            $_K_t2 = substr($_fgFieldK, -2);
                            if ('_g' == $_K_t2 && $_fgFieldV > 0) {
                                $_K_N = substr($_fgFieldK, 0, -2);
                                $_PostFlagNodeDisplayGroup = $tl_flags[$_K_N]['DisplayGroup'];
                                if (!empty($_PostFlagNodeDisplayGroup) && $_curGid != 1 && $_curGid != 2) {//管理员与超级版主都会显示
                                    if (!in_array($_curGid, $_PostFlagNodeDisplayGroup, true)) {
                                        if (in_array(USERSELF, $_PostFlagNodeDisplayGroup, true)) {
                                            if ($p_postflag[$_K_N . '_u'] != $p_thread['user']['uid']) {//帖子作者本人可见
                                                $F_denied = true;
                                            }
                                        } else
                                            $F_denied = true;
                                    }
                                }
                                if (!$F_denied) {
                                    $_PostFlagNodeAdditionClass = $tl_flags[$_K_N]['AdditionClass'];
                                    if (!empty($tl_flags[$_K_N]['stamp']) || !isset($tl_flags[$_K_N]['stamp'])) {
                                        if (isset($tl_flags[$_K_N]['stamp']) && is_string($tl_flags[$_K_N]['stamp']) && !in_array(strtolower($tl_flags[$_K_N]['stamp']), array('false', 'no', 'off', 'close', 'nothing', 'hide')))
                                            $other_thread_AdditionStamp[$_K_N] = $tl_flags[$_K_N]['stamp'];
                                        else
                                            $other_thread_AdditionStamp[$_K_N] = $_K_N;
                                    }
                                    if (!empty($_PostFlagNodeAdditionClass)) $thread_AdditionClass[$_K_N] = array('class'=>$_PostFlagNodeAdditionClass,'title'=>$tl_flags[$_K_N]['title']);
                                } else {
                                    break;
                                }
                            }
                        }
                        if ($F_denied) {
                            unset($threadlist[$p_tid]);
                        } else {
                            $p_thread['PostFlagClass'] = &$thread_AdditionClass;
                            $p_thread['PostFlagStamp'] = &$other_thread_AdditionStamp;
                        }
                        unset($thread_AdditionClass, $other_thread_AdditionStamp, $p_postflag);
                    }
                }
                unset($p_thread, $postflagRS);
            }
        }
        unset($enable_flags, $tl_flags, $tl_PostFlagCfg);
    }
